package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.CzEquipmentMapper;
import com.ruoyi.business.domain.CzEquipment;
import com.ruoyi.business.service.ICzEquipmentService;

/**
 * 设备Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-01-01
 */
@Service
public class CzEquipmentServiceImpl implements ICzEquipmentService 
{
    @Autowired
    private CzEquipmentMapper czEquipmentMapper;

    /**
     * 查询设备
     * 
     * @param equipmentId 设备主键
     * @return 设备
     */
    @Override
    public CzEquipment selectCzEquipmentByEquipmentId(String equipmentId)
    {
        return czEquipmentMapper.selectCzEquipmentByEquipmentId(equipmentId);
    }

    /**
     * 查询设备列表
     * 
     * @param czEquipment 设备
     * @return 设备
     */
    @Override
    public List<CzEquipment> selectCzEquipmentList(CzEquipment czEquipment)
    {
        return czEquipmentMapper.selectCzEquipmentList(czEquipment);
    }

    /**
     * 新增设备
     * 
     * @param czEquipment 设备
     * @return 结果
     */
    @Override
    public int insertCzEquipment(CzEquipment czEquipment)
    {
        czEquipment.setCreateTime(DateUtils.getNowDate());
        return czEquipmentMapper.insertCzEquipment(czEquipment);
    }

    /**
     * 修改设备
     * 
     * @param czEquipment 设备
     * @return 结果
     */
    @Override
    public int updateCzEquipment(CzEquipment czEquipment)
    {
        czEquipment.setUpdateTime(DateUtils.getNowDate());
        return czEquipmentMapper.updateCzEquipment(czEquipment);
    }

    /**
     * 批量删除设备
     * 
     * @param equipmentIds 需要删除的设备主键
     * @return 结果
     */
    @Override
    public int deleteCzEquipmentByEquipmentIds(String[] equipmentIds)
    {
        return czEquipmentMapper.deleteCzEquipmentByEquipmentIds(equipmentIds);
    }

    /**
     * 删除设备信息
     * 
     * @param equipmentId 设备主键
     * @return 结果
     */
    @Override
    public int deleteCzEquipmentByEquipmentId(String equipmentId)
    {
        return czEquipmentMapper.deleteCzEquipmentByEquipmentId(equipmentId);
    }
}
